import java.util.ArrayList;
import java.util.List;

class Computer {
    String brand;
    int cpuHz;

    public Computer(String brand, int cpuHz) {
        this.brand = brand;
        this.cpuHz = cpuHz;
    }

    @Override
    public String toString() {
        return "品牌: " + brand + ", CPU 主频: " + cpuHz + " MHz";
    }
}

class SxtStu {
    int id;
    String sname;
    int age;
    Computer c;

    public SxtStu(int id, String sname, int age, Computer c) {
        this.id = id;
        this.sname = sname;
        this.age = age;
        this.c = c;
    }

    void study() {
        System.out.println("我正在学习! 姓名: " + sname + ", 电脑配置: " + c);
    }
    
    public static void main(String[] args) {
        // 创建多台Computer实例
        Computer computer1 = new Computer("联想", 2400);
        Computer computer2 = new Computer("戴尔", 2600);
        Computer computer3 = new Computer("华硕", 2500);
        Computer computer4 = new Computer("苹果", 2800);

        // 创建多个SxtStu实例并将电脑分配给他们
        List<SxtStu> students = new ArrayList<>();
        students.add(new SxtStu(1, "张三", 20, computer1));
        students.add(new SxtStu(2, "李四", 21, computer2));
        students.add(new SxtStu(3, "王五", 22, computer3));
        students.add(new SxtStu(4, "赵六", 23, computer4));

        // 输出每个学生的电脑配置
        for (SxtStu student : students) {
            student.study();
        }
    }
}

